﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace M2Server
{
    public partial class M2Server : Form
    {

        #region M2Server Constants - Kyndig - 07/08/2010

        public const bool   ENGLISHVERSION          = true;
		public const bool   USAVERSION              = false;
        public const bool   PHILIPPINEVERSION       = false;
        public const bool   CHINAVERSION            = false;
        public const bool   TAIWANVERSION           = false;
        public const bool   KOREANVERSION           = false;

		public const int    SENDBLOCK               = 1024;
		public const int    SENDCHECKBLOCK          = 20000;
		public const int    SENDAVAILABLEBLOCK      = 20000;
		public const int	GATELOAD                = 10;
		public const string	LINENOTICEFILE          = @"Notice\LineNotice.txt";
		public const string	LINEHELPFILE            = @"LineHelp.txt";

		public const int    BUILDGUILDFEE           = 1000000;

		public const bool   ENCODEPASSWORD          = false;

        #endregion

        #region M2Server Variables - Kyndig 13/08/2010

		// RunSocket                                     :TRunSocket;
		// FrontEngine                                   :TFrontEngine;
		// UserEngine                                    :TUserEngine;
		// UserMgrEngine                                 :TUserMgrEngine;
		// GrobalEnvir                                   :TEnvirList;
		// ItemMan                                       :TItemUnit;
		// MagicMan                                      :TMagicManager;
		// NoticeMan                                     :TNoticeManager;
		// GuildMan                                      :TGuildManager;
		// GuildAgitMan                                  :TGuildAgitManager;
		// GuildAgitBoardMan                             :TGuildAgitBoardManager;
		int GuildAgitStartNumber;
		int GuildAgitMaxNumber;
		// EventMan                                      :TEventManager;
		// UserCastle                                    :TUserCastle;
		bool boUserCastleInitialized;
		// gFireDragon                                   :TDragonSystem;

		List<string> DecoItemList;
		List<string> MakeItemList;
		List<string> MakeItemIndexList;
		List<string> StartPoints;
		List<string> SafePoints;
		List<object> MultiServerList;
		List<object> ShutUpList; // quicklist
		List<string> MiniMapList;
		List<string> UnbindItemList;
		List<string> LineNoticeList;
		List<string> LineHelpList;

		// StartupQuestNpc                               :TMerchant;
        // FunctionNPC                                   :TMerchant;

		List<string>EventItemList;
		int EventItemGifeBaseNumber;
		int[] GrobalQuestParams = new int[9];

		string ErrorLogFile;
		int MirDayTime;
		int ServerIndex;
		string ServerName;
		int ServerNumber;

		bool BoVentureServer;
		bool BoTestServer;
		bool BoClientTest;
		int TestLevel;
		int TestGold;
		int TestServerMaxUser;
		bool BoServiceMode;
		bool BoNonPKServer;
		bool BoViewHackCode;
		bool BoViewAdmissionfail;
		bool BoGetGetNeedNotice;
		uint GetGetNoticeTime;

		int UserFullCount;
		int ZenFastStep;
		bool BoSysHasMission;
		string SysMission_Map;
		bool SysMission_X;
		bool SysMission_Y;
		bool TotalUserCount;

        /*
		csMsgLock                                     :TCriticalSection;
		csTimerLock                                   :TCriticalSection;
		csObjMsgLock                                  :TCriticalSection;
		csSendMsgLock                                 :TCriticalSection;
		csShare                                       :TCriticalSection;
		csDelShare                                    :TCriticalSection;
		csSocLock                                     :TCriticalSection;
		usLock                                        :TCriticalSection;
		usIMLock                                      :TCriticalSection;
		ruLock                                        :TCriticalSection;
		ruSendLock                                    :TCriticalSection;
		ruCloseLock                                   :TCriticalSection;
		socstrLock                                    :TCriticalSection;
		fuLock                                        :TCriticalSection;
		fuOpenLock                                    :TCriticalSection;
		fuCloseLock                                   :TCriticalSection;
		humanLock                                     :TCriticalSection;
		umLock                                        :TCriticalSection;
		SQLock                                        :TCriticalSection;
        */

		List<string> MainMsg;
		List<string> UserLogs;
		List<string> UserConAlarmLogs;
		List<string> UserConLogs;
		List<string> UserChatLog;
		bool DiscountForNightTime;
		int HalfFeeStart;
		int HalfFeeEnd;

		bool ServerReady;
		bool ServerClosing;
		int FCertify, FItemNumber;
		string RDBSocData;
		bool ReadyDBReceive;
		int RunFailCount;
		int MirUserLoadCount;
		int MirUserSaveCount;
		uint CurrentDBloadingTime;
		bool BoEnableAbusiveFilter;
		int LottoSuccess, LottoFail;
		int Lotto1, Lotto2, Lotto3;
		int Lotto4, Lotto5, Lotto6;

		string MsgServerAddress;
		int MsgServerPort;
		string LogServerAddress;
		int LogServerPort;
		string ShareBaseDir;
		string ShareVentureDir;
		int ShareFileNameNum;
		string ConLogBaseDir;
		string ChatLogBaseDir;

		string DefHomeMap;
		int DefHomeX;
		int DefHomeY; 
		string GuildDir;
		string GuildFile;
		string GuildBaseDir;
		string GuildAgitFile;
		string CastleDir;
		string EnvirDir;
		string MapDir;

		int CurrentMonthlyCard;
		int TotalTimeCardUsage;
		int LastMonthTotalTimeCardUsage;
		int GrossTimeCardUsage;
		int GrossResetCount;

		uint serverruntime;
		uint runstart;
		int rcount;
		int minruncount;
		int curruncount;
		int maxsoctime;
		int cursoctime;
		int maxusrtime;
		int curusrcount;
		int curhumtime;
		int maxhumtime;
		int curmontime;
		int maxmontime;
		uint humrotatetime;
		int curhumrotatetime;
		int maxhumrotatetime;
		int humrotatecount;
		string LatestGenStr;
		string LatestMonStr;

		uint HumLimitTime;
		uint MonLimitTime;
		uint ZenLimitTime;
		uint NpcLimitTime;
		uint SocLimitTime;
		uint DecLimitTime;

		string __ClothsForMan;
		string __ClothsForWoman;
		string __WoodenSword;
		string __Candle;
		string __BasicDrug;
		string __KillerSword;

		string __GoldStone;
		string __SilverStone;
		string __SteelStone;
		string __CopperStone;
		string __BlackStone;
		string __Gem1Stone;
		string __Gem2Stone;
		string __Gem3Stone;
		string __Gem4Stone;

		string __ZumaMonster1;
		string __ZumaMonster2;
		string __ZumaMonster3;
		string __ZumaMonster4;

		string __Bee;
		string __Spider;
		string __WhiteSkeleton;
		string __ShinSu;
		string __ShinSu1;
		string __AngelMob;
		string __CloneMob;
		string __WomaHorn;
		string __ZumaPiece;

		string __GoldenImugi;
		string __WhiteSnake;

		string ClientFileName1;
		string ClientFileName2;
		string ClientFileName3;
		int ClientCheckSumValue1;
		int ClientCheckSumValue2;
		int ClientCheckSumValue3;

		int gErrorCount;
		int g_TestTime;

		int g_SpeedHackCheck;
		string g_SpeedHackCheckChar;

        int g_CryWide;

        #endregion

        public M2Server()
        {
            InitializeComponent();
        }

        private void M2Server_Load(object sender, EventArgs e)
        {

        }

        #region Timer Ticks - Kyndig - 07/08/2010

        private void ConnectTimer_Tick(object sender, EventArgs e)
        {
            // TODO
        }

        private void SaveVariableTimer_Tick(object sender, EventArgs e)
        {
            // TODO
        }

        private void StartTimer_Tick(object sender, EventArgs e)
        {
            // TODO
        }

        private void RunTimer_Tick(object sender, EventArgs e)
        {
            // TODO
        }

        private void CloseTimer_Tick(object sender, EventArgs e)
        {
            // TODO
        }

        #endregion

    }
}
